import os

domainname= os.environ.get('DOMAIN_NAME')
domainpath= '/u01/Oracle/Middleware/user_project/domains/%s' %domainname
password= os.environ.get('PASS_WORD')
adminport= os.environ.get('ADMIN_PORT')
appname = os.environ.get('APP_NAME','EbizServices')
apppkg = os.environ.get('APP_PKG_FILE','EbizServices_V4.44.0_4.jar')
appdir = os.environ.get('APP_PKG_LOCATION','/u01/Oralce')

print('domainpath : [%s]' % domainpath);
print('domainname : [%s]' % domainname);
print('password : [%s]' % password);
print('adminport : [%s]' % adminport);

readDomain("%s" % domainpath)
connect("weblogic","%s" % password,"t3://localhost:%s" %adminport)

applist=listApplications()
##undeploy('')
undeploy('%appname' % appname)

deploy('%appname' % appname,'%appdir' % appdir,targets='AdminServer')
##startApplication
startApplication('%appname' % appname, stageMode='NOSTAGE', testMode='false')

exit()

